package com.mvvm.store.roombatabase;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;


import com.mvvm.store.bean.basebean.MaterialInfoBean;
/**
 * 入库存储
 */
import java.util.List;

@Dao
public interface IntoInfoDao {
    //查询所有的扫码物料信息根据 orderNumber
    @Query("SELECT * FROM MaterialInfoBean WHERE orderNumber=:orderNumber")
    List<MaterialInfoBean> getAll(String orderNumber);

    //根据扫码的订单号查询对于的该订单信息
    @Query("SELECT * FROM MaterialInfoBean WHERE oddNumber=:oddNumber")
    List<MaterialInfoBean> getStockUpInfoByOddNumber(String oddNumber);

    //查询标签是否存在
    @Query("SELECT * FROM MaterialInfoBean WHERE lableNumber=:lableNumber")
    List<MaterialInfoBean> getStockUpInfoByLableNumber(String lableNumber);

    //新增扫码数据
    @Insert
    void insertAll(MaterialInfoBean... stockUpInfoBean);

    //修改单挑记录
    @Update
    void updateStudent(MaterialInfoBean... users);


    //删除对于的备案数据
    @Delete
    void delete(MaterialInfoBean user);


    //根据id查询对于的物料信息
    @Query("SELECT *FROM MaterialInfoBean WHERE sId=:sId")
    List<MaterialInfoBean> getStockUpInfoById(int sId);
}
